package com.xiemu.ironman.core.rest;

import com.xiemu.ironman.core.utils.ApiUtils;
import com.xiemu.ironman.sdk.Calculator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("/test")
public class CalculatorController {

    @Autowired
    private Calculator calculator;

    @GetMapping(value = "/cal")
    public Object uploadFile(int a,int b) throws Exception {
        int add = calculator.add(a, b);
        return ApiUtils.getApiResult(add);
    }
}
